package hr.fer.zemris.EvolutionOps;

import java.util.List;
import java.util.Random;

import org.uncommons.maths.random.Probability;
import org.uncommons.watchmaker.framework.EvolutionaryOperator;

public class RecombinationOperator<T> implements EvolutionaryOperator<T> {
	private Probability probability;
	private IRecombiner<T> recombiner;
	
	public RecombinationOperator(IRecombiner<T> recombiner, Probability probability) {
		this.probability = probability;
		this.recombiner = recombiner;
	}

	@Override
	public List<T> apply(List<T> selectedCandidates, Random rng) {
		return recombiner.recombine(selectedCandidates, probability, rng);
	}
}
